#ifndef					__SOUNDMANAGER_HH_
# define				__SOUNDMANAGER_HH_

# include				<QtWidgets/QMainWindow>
# include				<QObject>
# include				"Listener.h"
# include				"Encoder.h"
# include				"Decoder.h"
# include				"Speaker.h"

class						SoundManager : public QObject
{
	Q_OBJECT

public:
	SoundManager();
	~SoundManager();
	void					play(ISoundPacket *, unsigned int);
	void					takeOrder(IOrder *order);
	ISoundPacket			*decode(IEncodedSoundPacket *);
	IEncodedSoundPacket		*encode(ISoundPacket *);
	void					decode(IEncodedSoundPacket *, ISoundPacket *);
	void					encode(ISoundPacket *, IEncodedSoundPacket *);
	void					setInput(bool);
	void					setOutput(bool);

private:
	IListener				*_listener;
	IEncoder				*_encoder;
	IDecoder				*_decoder;
	ISpeaker				*_speaker;
public slots:
	void					readBufferFull();
signals:
	void					_readBufferFull(ISoundPacket *packet);
};

#endif					// __SOUNDMANAGER_HH_
